package com.atguigu.lease.common.utils;

import java.util.Random;

/**
 * @author cxt
 * &#064;Description 随机生成一个code 长度为传入的参数
 * &#064;create 2025/3/21 上午8:32
 */
public class CodeUtil {
    public static String getRandomCode(int length) {
        StringBuilder builder = new StringBuilder();
        Random random = new Random();
        for (int i = 0; i < length; i++) {
            builder.append(random.nextInt(10));
        }
        return builder.toString();
    }
}
